
/*
 * Records Package
 */
package edu.gatech.oad.records;

import edu.gatech.oad.persistence.PersistentObject;

/**
 * Represents the cost of a treatment
 * @author Nathan Hurley
 * @version 1.0
 */
public class Cost extends PersistentObject {
	
	/**
	 * Serializable variable
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * cost of the treatment
	 */
	private double treatmentCost;
	
	/**
	 * name of the treatment
	 */
	private String description;
	
	/**
	 * Constructor for a cost object building an association between a name and a cost
	 * @param description the name of the treatment
	 * @param cost the cost of the treatment
	 */
	public Cost(String description, double cost){
		if(description == null){
			this.description = "Other";
		}
		else{
			this.description = description;
		}
		this.treatmentCost = cost;
	}
	
	/**
	 * @return the cost
	 */
	public double getCost(){
		return treatmentCost;
	}
	
	/**
	 * @param treatmentCost the new cost of the treatment
	 */
	public void setCost(double treatmentCost){
		this.treatmentCost = treatmentCost;
	}
	
	/**
	 * @param description the new description
	 */
	public void setDescription(String description){
		this.description = description;
	}
	
	/**
	 * @return the description of the treatment
	 */
	public String getDescription(){
		return description;
	}
	
	/**
	 * Implementation of the toString for Cost
	 * @return the description followed by the cost
	 */
	public String toString(){
		return description + " " + treatmentCost;
	}
}
